<!DOCTYPE html>
<div class="modal-header">
	<div class="modal-title">新增任务</div>
</div>

<div class="modal-body">
	<form class="form-horizontal">
		<div class="control-group">
			<label class="control-label width135"> 任务类型 </label>
			<div class="controls">
				<div class="input-prepend">
					<select class="input-large width248" ng-model="modalDatas.type">
						<option value="BEAN">实例模式</option>
						<option value="SCRIPT">脚本模式</option>
					</select>
				</div>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label width135"> 执行器 </label>
			<div class="controls">
				<div class="input-prepend">
					<select class="input-large width248"
						ng-change="$ctrl.executorChange()"
						ng-disabled="modalDatas.type == 'SCRIPT' && !modalDatas.useExecutor"
						ng-model="modalDatas.executorId">
						<option ng-repeat="executor in modalDatas.executorList"
							value="{{executor.id}}">{{executor.name}}</option>
					</select>
					<div class="checkbox"
						style="display: inline-block; margin-left: 5px"
						ng-if="modalDatas.type == 'SCRIPT'">
						<label> <input type="checkbox"
							ng-model="modalDatas.useExecutor"> 指定执行器
						</label>
					</div>
				</div>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label width135"> 任务描述 </label>
			<div class="controls">
				<div class="input-prepend">
					<input type="text" ng-model="modalDatas.name"
						class="input-large width235">
				</div>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label width135"> 执行逻辑 </label>
			<div class="controls">
				<div class="input-prepend">
					<select class="input-large width248" ng-model="modalDatas.jobKey"
						ng-disabled="modalDatas.type == 'SCRIPT'">
						<option ng-repeat="job in modalDatas.jobs" value="{{job.jobKey}}">{{job.jobDesc}}({{job.jobKey}})</option>
					</select>
				</div>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label width135"> Cron </label>
			<div class="controls">
				<div class="input-prepend">
					<input type="text" ng-model="modalDatas.cron"
						class="input-large width235">
				</div>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label width135"> 参数 </label>
			<div class="controls">
				<div class="input-prepend">
					<input type="text" ng-model="modalDatas.param"
						class="input-large width235">
				</div>
			</div>
		</div>
		<div class="control-group error">
			<div class="help-inline error-message margin-left180">{{modalDatas.error}}</div>
		</div>
	</form>
</div>

<div class="modal-footer">
	<button class="btn btn-info" type="button" ng-click="$ctrl.ok()">确定</button>
	<button class="btn" type="button" ng-click="$ctrl.cancel()">取消</button>
</div>